package com.jcl.recruit.server.emessage;

import com.jcl.core.utils.CollectionUtils;

import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName MailMessage

 * @Author yyliu
 * @Date 2018/11/12 11:03
 * @Version 1.0
 **/
public class MailMessageVo {

    private String subject;

    private String from;

    private String to;

    private String content;

    private List<File> fileList;

    private Map<String, String> resourceMap;

    public void addResource(String rscId, String rscPath){
        if(CollectionUtils.isEmpty(resourceMap)){
            resourceMap = new LinkedHashMap<>();
        }
        resourceMap.put(rscPath, rscId);
    }

    public void addFile(File file){
        if(CollectionUtils.isEmpty(fileList)){
            fileList = new ArrayList<>();
        }
        fileList.add(file);
    }

    public void addFile(String file){
        File f = new File(file);
        addFile(f);
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<File> getFileList() {
        return fileList;
    }

    public void setFileList(List<File> fileList) {
        this.fileList = fileList;
    }

    public Map<String, String> getResourceMap() {
        return resourceMap;
    }
}
